import json


with open('data.json', 'r') as f:
    data = json.load(f)

total_count = len(data)
correct_count = 0
for item in data:
    audio_file = item['audio_path']
    text_gt = audio_file.split('.')[0].split('\\')[-1]
    text_pred = item['text']
    if text_gt == text_pred:
        correct_count += 1
    print(f"Text GT: {text_gt}")
    print(f"Text Pred: {text_pred}")


print(f"音频文件总数: {total_count}, 预测正确的音频文件数: {correct_count}, 准确率: {correct_count/total_count}")